import React from 'react'
const { $fn, $Lazy } = window
// ===================================================================== private template
const Menu = $Lazy.load(()=>import('#frame/menu'))

const contract_record =  { title: '合同签订记录', 	path: 'contract-record', component:'business-manage/contract-manage/contract-record' }
// ===================================================================== 业务管理
class Index extends React.Component{
	state = {
		data:[]
	}
	
	skip = { to: 'business-manage/hospital-manage/my-hospital' }
	
	child = [
		// 医院管理
		{
			id: 'yygl', 
			parent: '/business-manage/hospital-manage/my-hospital',
			children: [
				{ title: '编辑、查看', path: 'edit', cache:true, component:'business-manage/hospital-manage/edit'},
				{ title: '物价管理', path: 'price-control', cache:true, component:'business-manage/customer-manage/hospital-customer/price-control' },
			]
		},
		{
			id: 'yygl', 
			parent: '/business-manage/hospital-manage/sub-hospital',
			children: [
				{ title: '编辑、查看', path: 'edit', cache:true, component:'business-manage/hospital-manage/edit'},
			]
		},
		// 我的合同管理
		{
			id: 'operation-htgl', 
			parent: '/business-manage/contract-manage/my-contract',
			children: [
				{ title: '编辑、查看', path: 'edit', cache:true, component:'business-manage/contract-manage/edit'},
				contract_record
			]
		},
		// 下级合同管理
		{
			id: 'operation-htgl', 
			parent: '/business-manage/contract-manage/sub-contract',
			children: [
				{ title: '编辑、查看', path: 'edit', cache:true, component:'business-manage/contract-manage/edit'},
				contract_record
			]
		},
		// 合同管理
		{
			id: 'khgl', 
			parent: '/business-manage/customer-manage/contract-manage',
			children: [
				{ title: '编辑、查看', path: 'edit', cache:true, component:'business-manage/contract-manage/edit'},
				contract_record
			]
		},
		// 医院客户
		{
			id: 'khgl', 
			parent: '/business-manage/customer-manage/hospital-customer',
			children: [
				{ title: '物价管理', 	path: 'price-control' },
				{ title: '编辑、新增', path: 'edit', cache:true, component:'business-manage/hospital-manage/edit'}
			]
		},
		// 医院客户
		{
			id: 'ywgl', 
			parent: '/business-manage/operational-control/salesman-manage',
			children: [
				{ title: '绑定医院', 	path: 'bind-hospital' },
			]
		},
		// 台账记录
		{
			id: 'ledger-f', 
			parent: '/business-manage/ledger/parameter-list',
			children: [
				{ title: '账单金额', 	path: 'receivable', component:'finance-manage/ledger/receivable' },
				{ title: '回款调整', 	path: 'receivable-records', component:'finance-manage/ledger/receivable-records/index',
					children:[
						{ title: '回款调整记录', path: 'returned', component:'finance-manage/ledger/returned' },
						{ title: '退款记录', 	path: 'refund', component:'finance-manage/ledger/refund' },
					]
				 },
				{ title: '已开发票', 	path: 'invoice', component:'finance-manage/ledger/invoice/index' },
			]
		},
		// 回款记录
		{
			id: 'ledger-f', 
			parent: '/business-manage/ledger/receivable-records',
			children: [
				{ title: '回款调整记录', path: 'returned', component:'finance-manage/ledger/returned' },
				{ title: '退款记录', 	path: 'refund', component:'finance-manage/ledger/refund' },
			]
		},
	]
	
	componentDidMount(){
		$fn.getMenu.call(this, 'ywxt', this.child)
	}
	
	render(){
		return <Menu data={this.state.data} skip={ this.skip } />
	}
}

export default Index